import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { viteMockServe } from "vite-plugin-mock";

import setupSvgIcon from "./svg-icon";

export default function setupVitePlugins(env, isBuild) {
  const plugins = [
    vue(),
    vueJsx(),
    viteMockServe({
      mockPath: "mock",
      localEnabled: true,
      prodEnabled: false,
    }),
  ];
  plugins.push(setupSvgIcon(isBuild));
  return plugins;
}
